import Vue from 'vue'
import App from './App.vue'
// 导入1级路由
import Index from "./views/Index.vue"
import News from "./views/News.vue"
import Sports from "./views/Sports.vue"
// 导入2级路由
import SportsIndex from "./views/second/SportsIndex.vue"
import InlandSports from "./views/second/InlandSports.vue"
import ForeignSports from "./views/second/ForeignSports.vue"

Vue.config.productionTip = false
// 导入路由
import vueRouter from "vue-router"
Vue.use(vueRouter)
let routes = [{
    path: "/",
    redirect: "index"
  }, {
    path: "/index",
    component: Index
  }, {
    path: "/news",
    component: News
  },
  {
    path: "/sports",
    component: Sports,
    children: [{
      path: "",
      redirect: "si"
    }, {
      path: "si",
      component: SportsIndex
    }, {
      path: "is",
      component: InlandSports
    }, {
      path: "fs",
      component: ForeignSports
    }]
  }
]

let router = new vueRouter({
  routes
})

new Vue({
  render: h => h(App),
  router
}).$mount('#app')